# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
pkgname=sdl2_mixer
pkgver=2.0.2
pkgrel=2
pkgdesc="A simple multi-channel audio mixer (Version 2)"
arch=('x86_64')
url="http://www.libsdl.org/projects/SDL_mixer"
license=('MIT')
depends=('sdl2' 'libvorbis' 'libmodplug' 'mpg123' 'flac')
makedepends=('fluidsynth')
optdepends=('fluidsynth: MIDI software synth, replaces built-in timidity')
source=("https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-${pkgver}.tar.gz")
sha512sums=('c40b5ac93933df1cc932e7afe796ad6765aafb24077601a23f98ac625a83341079ad903c164eafd022aff6011872e7a7956eebd8e3d3edad1bf5dc7eb9c306b7')

prepare() {
  cd "${srcdir}/SDL2_mixer-${pkgver}/"

  sed -i "s|/etc/timidity|/etc/timidity++|g" timidity/options.h
  sed -i "s|/etc/timidity++.cfg|/etc/timidity++/timidity.cfg|g" timidity/options.h
}

build() {
  cd "${srcdir}/SDL2_mixer-${pkgver}/"

  ./configure --disable-static --prefix=/usr
  make
}

package() {
  cd "${srcdir}/SDL2_mixer-${pkgver}/"

  make DESTDIR="${pkgdir}" install
  install -Dm644 COPYING.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
